package com.ruoyi.project.oms.paeaAuBatch.enums;

import java.util.HashMap;
import java.util.Map;

public enum AuBatchStatus {
	未日结50(50, "未日结"),Initial(100, "未监控"), Partially_Audited(150, "部分监控"), Auditing(180, "正在监控"),

	Audited(200, "已监控");

	public static AuBatchStatus toAuBatchStatus(Integer value) {
		return codeMap.get(value);
	}

	public static String getColorByCode(Integer value) {
		if (value == AuBatchStatus.Initial.getValue())
			return "black";
		if (value == AuBatchStatus.Partially_Audited.getValue())
			return "blue";
		if (value == AuBatchStatus.Auditing.getValue())
			return "black";
		if (value == AuBatchStatus.Audited.getValue())
			return "green";
		return "black";
	}

	public static String getNameByCode(Integer value) {
		if (value == null)
			return "未知状态";

		AuBatchStatus status = codeMap.get(value);
		if (status != null) {
			return status.getName();
		}
		return "未知状态";
	}

	private static Map<Integer, AuBatchStatus> codeMap;
	private static Map<String, AuBatchStatus> nameMap;
	static {
		codeMap = new HashMap<Integer, AuBatchStatus>();
		nameMap = new HashMap<String, AuBatchStatus>();
		for (AuBatchStatus status : AuBatchStatus.values()) {
			codeMap.put(status.getValue(), status);
			nameMap.put(status.getName(), status);
		}
	}
	private Integer value;
	private String name;

	private AuBatchStatus(int value, String name) {
		this.value = value;
		this.name = name;
	}

	public int getValue() {
		return value;
	}

	public String getName() {
		return name;
	}

	public String toString() {
		return this.getValue() + "-" + this.getName();
	}

	public static void main(String[] args) {
		for (AuBatchStatus status : AuBatchStatus.values()) {
			//System.out.println(status);
		}
	}
}
